Previously we assumed the buffer was being displayed in a window
of the current frame, which isn't the case if e.g. a child frame
is being used.
We also cannot assume that the third-party code that sets up such
a child frame also deletes it. `which-key-posframe' for example
merely hides it.
(defun which-key--popup-showing-p ()
(and (bufferp which-key--buffer)
- (window-live-p (get-buffer-window which-key--buffer))))
+ (or (window-live-p (get-buffer-window which-key--buffer))
+ (let ((window (get-buffer-window which-key--buffer t)))
+ (and (window-live-p window)
+ (frame-visible-p (window-frame window)))))))
(defun which-key--show-popup (act-popup-dim)
"Show the which-key buffer.